using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ibba.agil.core;
using ibba.agil.core.common;

namespace ibba.agil.data.data
{
    public class tbagi019ParmPrsoIpi_ENT : EntityData, IDataEntity
    {
        private manager.tbagi019ParmPrsoIpi_MNG _manager;

        #region Data

        public int idtParmPrsoIpi { get; set; } 
public int idtCrtr { get; set; } 
public string nomParmIpi { get; set; } 
public string txtParmIpi { get; set; } 
public string desParmIpi { get; set; } 
   

        #endregion

         /// <summary>
        /// Construtor necessario para configura��o dos mapeamentos :: Entidade < -- > TABELA
        /// </summary>
        public tbagi019ParmPrsoIpi_ENT()
        {
            // determina o mapeamento entre a tabela e entidade
            base.MapperTable = new Dictionary<string, string>() { { this.GetType().Name, "dbo.TBAGI019_PARM_PRSO_IPI" } };

            // determina o mapeamento entre a coluna da tabela e propriedade
            base.Mapper = new Dictionary<string, string>() { 
                     {"idtParmPrsoIpi", "IDT_PARM_PRSO_IPI"}, 
                     {"idtCrtr", "IDT_CRTR"                }, 
                     {"nomParmIpi", "NOM_PARM_IPI"         }, 
                     {"txtParmIpi", "TXT_PARM_IPI"         }, 
                     {"desParmIpi", "DES_PARM_IPI"         }          
            };

            // determina o mapeamento das chaves
            base.MapperKeys = new Dictionary<string, string>() { 
                    //DictionaryEntityKey//
                     {"idtParmPrsoIpi", "IDT_PARM_PRSO_IPI"    }
            };

            // determina se a chave � identity
            //base.MapperKeyIsNotIdentity = false;

            // instancia o manager
            _manager = new manager.tbagi019ParmPrsoIpi_MNG();
        }

        public override void Save()
        {
            _manager.Save(this);
        }

        public override void Save(TransactionManager transactionContext)
        {
            _manager.Save(this, transactionContext);
        }

        public override void Delete()
        {
            _manager.Delete(this);
        }

        public override void Delete(TransactionManager transactionContext)
        {
            throw new NotImplementedException();
        }
    }
}
